package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.user.userService;
import com.sky.vo.UserLoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description userController
 * @Author luohai
 * @Date 2024-10-13
 */
@RestController
@RequestMapping("/user/user")
public class userController {
    @Autowired
    private userService userService;

    /**
     * 用户登录
     * @param userLoginDTO
     * @return
     */
    @PostMapping("/login")
    public Result userLogin(@RequestBody UserLoginDTO userLoginDTO){
        UserLoginVO userLoginVO=userService.userLogin(userLoginDTO);
        return Result.success(userLoginVO);
    }
}
